package com.webull.information.center.carwler.dao;

import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;

import com.webull.information.center.carwler.common.model.NetIpConfig;

/**
 * Ip信息
 * 
 * @author shimingjun
 * @date 2016年7月5日 上午11:39:12
 * @version 1.0
 * @since JDK 1.8
 */

@Repository
public class NetIpConfigDao {
	private static final RowMapper<NetIpConfig> netIpConfigRM = BeanPropertyRowMapper.newInstance(NetIpConfig.class);
	protected final Logger logger = LogManager.getLogger(getClass());

	private @Autowired JdbcTemplate jdbcTemplate;

	private @Autowired NamedParameterJdbcTemplate namedParameterJdbcTemplate;

	public List<NetIpConfig> SearchAll() {
		return jdbcTemplate.query(Sql.SEARCHALL, netIpConfigRM);
	}

	private class Sql {
		private static final String SEARCHALL = "select * from wli_net_ip_config where del = 0";
	}

}
